package com.osfw.framework.utils.convert;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Component;

@Component("osfwJson")
public class JsonUtils {

    /**
     * 将对象转换为Json字符串
     *
     * @param src
     * @return java.lang.String
     */
    public static String toJson(Object src) {
        if(src != null){
            return JSON.toJSONString(src);
        }
       return "";
    }

}
